home *** CD-ROM | disk | FTP | other *** search
/ BlastDOS / [DOS_Application]_BIT_Software_-_BitCom_3.58c_-_Distribution_Disks.zip / SCRIPT.TXT < prev    next >
Text File  |  1989-10-09  |  94KB  |  2,028 lines

  1.  
  2.  
  3.  
  4.                                                                        1
  5.  
  6.  
  7.  
  8.                             Creating Script/Action Files
  9.             
  10.             
  11.             
  12.             Automatic Logon With Script/Action Files
  13.             ----------------------------------------
  14.             If you  call a  certain number frequently, you will probably
  15.             want to  set up an automatic log on file so you don't always
  16.             have to  remember the correct log on sequence.  This is done
  17.             with BitCom's action files.
  18.             
  19.             The BitCom  script and  action file  commands are similar to
  20.             computer  programming  languages  such  as  BASIC  or  macro
  21.             commands in  Lotus 1-2-3 or other programs.  You do not need
  22.             to use  them to  communicate using  BitCom, but it will help
  23.             you to work more efficiently.
  24.             
  25.             Script and  action files  are regular  DOS text  files  that
  26.             contain instructions  that tell BitCom what to do.  They are
  27.             created, stored,  and edited  just like any other text files
  28.             in DOS.   There  is no  limit as  to the  number of  lines a
  29.             script or  action file  can contain.   You  can even call an
  30.             action file from another action file.
  31.             
  32.             To create your own auto-log file (ACTION file), use any word
  33.             processor or  text editor  capable of  creating  text  files
  34.             (such as PE, or EDLIN).  If you use WordStar, or any program
  35.             that includes formatting codes within the file, use the non-
  36.             document (or  ASCII) mode.  Your ACTION file simply contains
  37.             lines of  instructions or statements that tell BitCom how to
  38.             do an auto logon.
  39.             
  40.             Included on  the program  diskette  are  sample  script  and
  41.             action files  (which have  a filename  extension of  .ACT or
  42.             .SCP).  These files can be printed using whatever method you
  43.             normally use  to print text files.  Refer to the end of this
  44.             section for a complete description of the script/action file
  45.             commands.
  46.             
  47.             Creating and Using a Script/Action File
  48.             ---------------------------------------
  49.             To use  a script/action  file,  you  would  go  through  the
  50.             following steps.
  51.             
  52.             1.   Exit from BitCom.
  53.             
  54.  
  55.  
  56.                                                                        2
  57.  
  58.  
  59.  
  60.             2.   Start  your   word  processor.     Instead  of  a  word
  61.                  processor, you  may also  use EDLIN or any text editor.
  62.                  You  should   create  a  file  without  any  formatting
  63.                  commands.   The filename must have an extension of .ACT
  64.                  for an action file, or .SCP for a script file.  You can
  65.                  edit any existing script or action file that we provide
  66.                  on the diskette.
  67.             
  68.             3.   Create and  save the  file. For example, you would type
  69.                  the lines  shown in the example above to create a logon
  70.                  file for  Easylink.   Move the  file to the BitCom sub-
  71.                  directory.
  72.             
  73.             4.   Bring  up   the  BitCom   Main  Menu.     Choose   '1',
  74.                  Communications   Selection Menu.   Position the pointer
  75.                  next to  the desired  Record ID  and press  "S" to Show
  76.                  More.  If you wish, you may instead add a record.
  77.             
  78.             5.   On the  Communications  Parameters  Menu  shown,  under
  79.                  AUTOLOG FILE,  type the  name  of  the  file  that  you
  80.                  created in  step 3  above.   The pathname  may also  be
  81.                  included if  the file  is not in the current path.  For
  82.                  example:   C:\WS\EASYLINK.   The filename  extension of
  83.                  .ACT should not be included.
  84.             
  85.             Sample Action Files
  86.             -------------------
  87.             As a  simple example, to send a RETURN (CR or Hex 0D) to the
  88.             host computer, create the line:
  89.             
  90.                  "$0D"
  91.             
  92.             To send a line feed (Hex 0A), create the line:
  93.             
  94.                  "$0a"
  95.             
  96.             To send  a string  of characters,  followed  by  a  carriage
  97.             return and line feed, create the line:
  98.             
  99.                  "HELLO$0D$0A"
  100.             
  101.             In fact,  you may send any combination of ASCII codes to the
  102.             host by  using the dollar sign ($) followed by a hex number,
  103.             within  quotes.     Upper/lower   case  of  hex  numbers  is
  104.             irrelevant.  The double quotes indicate that the text within
  105.             them is to be sent through the COM port.
  106.             
  107.             Any characters between opened and closed braces '{}' will be
  108.             treated as  a comment,  and ignored by BitCom.  All comments
  109.             must begin and end on the same line.
  110.             
  111.  
  112.  
  113.                                                                        3
  114.  
  115.  
  116.  
  117.             The following  is a  sample autolog file that is used to log
  118.             on to the CompuServe service:
  119.             
  120.             {Autologon file for CompuServe Network}
  121.             twait(1,"sec")                {wait for 1 second}
  122.             "$03"                         {send Ctl-C character hex 03}
  123.             cwait("ID:")                  {wait until the host}
  124.                                           {sends the 'ID' string }
  125.             "xxxxx,yyy$0d"                {send login ID}
  126.                                           {followed by carriage return}
  127.                                           {hex 0d return}
  128.             cwait("word:")                {wait for pass'word:'}
  129.                                           {prompt}
  130.             "xxxxx/yyyyy$0d"              {send password}
  131.                                           {followed by carriage return}
  132.             invoke handykey               {invoke another file}
  133.                                           {which defines some keys}
  134.             
  135.             The general  sequence as  given above  can be  used for most
  136.             services (i.e. wait for a string, send a response).
  137.             
  138.             The file 'HANDYKEY.ACT' defines the following keys.
  139.             
  140.             {This file defines some}
  141.             {handy function keys}
  142.             @alt-a='sendfile(prompt("Enter filename:"),"xmodem")'
  143.             @alt-c='@a=prompt("Enter color code:");z#setatt(@a)'
  144.             @alt-d='{Give DOS cmd}@a=prompt("Enter DOS cmd:");dos(@a)'
  145.             @alt-e='{echo on} echo = 1;'
  146.             @alt-n='{echo off} echo = 0;'
  147.             @alt-t='{display time}typecr("Current time is @ctime")'
  148.             @alt-h='{hangup phone} hangup; "ATH$0d"'
  149.             @alt-x='@maxrow=44;dos("setmode   -ammono   -c132   -r44   -
  150.             mmon");clear;z#setmar(1,44)'
  151.             @alt-y='@maxrow=25;dos("setmode   -ammono    -c80   -r25   -
  152.             mmon");clear'
  153.             @alt-s='{let the host get a file} invoke sendfile.act'
  154.             @alt-z='{Clear screen} clear'
  155.             
  156.             You can  also create more complicated action files to prompt
  157.             you for  information, and operate differently depending upon
  158.             the keys  pressed or  words received from the host computer.
  159.             See the end of this section for more details.
  160.             
  161.             See below the action file which is on your program diskette.
  162.             This is used to logon to the Easylink network.
  163.             
  164.  
  165.  
  166.                                                                        4
  167.  
  168.  
  169.  
  170.             cwait("ID?")
  171.             "00 EIDxxxxx yyyyyyy$0d" {your own acct # and password}
  172.             cwait("PTS")
  173.             TYPE("PLEASE TURN ON PRINTER")
  174.             cwait("PTS")             {wait for Easylink ready again}
  175.             printer(1)               {print function on}
  176.             "/MBX$0a"                {read mailbox, print and capture}
  177.             cwait("PTS")             {wait for Easylink ready again}
  178.             printer(0)               {print function off}
  179.             invoke handykey
  180.             
  181.             Another example  is shown  below.  This is the sample action
  182.             file used to log in to The Source.
  183.             
  184.             @RETURN;@RETURN
  185.             CWAIT("=")
  186.             "D1";@RETURN
  187.             CWAIT("@@")
  188.             "C xxxxx";@RETURN
  189.             CWAIT(">")
  190.             "ID yyyyyy";@RETURN
  191.             CWAIT(":?");
  192.             "TEST";@RETURN;
  193.             
  194.             Replace the  'x' and  'y' characters  with your  own ID  and
  195.             password.
  196.             
  197.             The sample  action file below is used to log on to Dow Jones
  198.             News Retrieval through Tymnet.
  199.             
  200.             TWAIT(5,"SEC")      {WAIT 5 SECONDS}
  201.             "A"                 {SEND AN "a"}
  202.             CWAIT("log in")     {WAIT FOR "log in"}
  203.             "DOW1;;"            {SEND DOW1;}
  204.             CWAIT("?")          {WAIT FOR ?}
  205.             "DJNS$0d"           {SEND DJNS & CR}
  206.             CWAIT("PASSWORD")   {WAIT FOR PASSWORD}
  207.             "xxxxxx$0d"         {REPLACE x's WITH YOUR P/W}
  208.             
  209.             Run a Script File From DOS
  210.             --------------------------
  211.             Script files  can also  be run  from the  DOS command  line.
  212.             This feature  allows you to do unattended operations without
  213.             having to  go through the menus.  The syntax to run a SCRIPT
  214.             file from the DOS command line is:
  215.             
  216.                  BITCOM @FILENAME.SCP [arg_1 arg_2...argn]
  217.             
  218.             where  FILENAME   is  the  name  of  the  script  file,  and
  219.             arg1...argn are  optional arguments  that can be included if
  220.             they are required by the SCRIPT file.
  221.             
  222.  
  223.  
  224.                                                                        5
  225.  
  226.  
  227.  
  228.             For example,  the SCRIPT  file  DIAL.SCP  that  is  on  your
  229.             program diskette  can be  invoked from the DOS command line,
  230.             or in a batch file as:
  231.             
  232.                  BITCOM @DIAL.SCP EASYLINK MCI
  233.             
  234.             This  line   will  start  BitCom,  invoke  the  SCRIPT  file
  235.             DIAL.SCP, using the arguments of EASYLINK and MCI, which are
  236.             records in  your phone  number database.  Note that you must
  237.             include a  space between  BITCOM and  the filename, and also
  238.             between the filename and each argument.
  239.             
  240.             When you  start BitCom  and invoke  a script file using this
  241.             method, your  script file must contain the CANCEL command to
  242.             quit BitCom  and return  to DOS.  In the example above, when
  243.             the line  is disconnected,  BitCom will  NOT return  to DOS.
  244.             Instead, the  script file  would be started over again, just
  245.             as it did when you started it the first time.
  246.             
  247.             Script/Action File Syntax
  248.             -------------------------
  249.             The following  section presents  the  language  rules  (i.e.
  250.             syntax and   semantics),  as well  as the various procedures
  251.             available for BitCom SCRIPT and ACTION files.
  252.             
  253.             If you  are a  beginner, we  suggest that  you look  at  the
  254.             sample action  files on the program diskette, and start with
  255.             simple ones such as EASYLINK.ACT.
  256.             
  257.             There are  two types of files in which language controls may
  258.             be given.  They are:
  259.             
  260.             1.   ACTION Files - These files have a filename extension of
  261.                  .ACT and  may  contain  function  key  definitions  and
  262.                  commands to control automatic logon or other common key
  263.                  sequences.   ACTION files  are invoked automatically to
  264.                  perform tasks after you have made a connection with the
  265.                  host computer.
  266.             
  267.             2.   SCRIPT Files - These files have a filename extension of
  268.                  .SCP and may contain commands to control when to call a
  269.                  certain number, how many times to retry, and what to do
  270.                  if the  connection is  (or is not) established.  SCRIPT
  271.                  files are  invoked to  make a  connection with the host
  272.                  computer.  Note that when you use a Script file to make
  273.                  a connection,  and an  action file  is specified on the
  274.                  Communication Parameters  Menu, the Action file will be
  275.                  automatically invoked  after the  connection  is  made.
  276.                  Most commands used in a script file can also be used in
  277.                  an action  file.   Therefore, a script file can contain
  278.                  all the commands necessary for a communications session
  279.                  without having an action file.
  280.  
  281.  
  282.                                                                        6
  283.  
  284.  
  285.  
  286.             
  287.             These files  can be  created with any text editor capable of
  288.             creating standard  "text" files  (e.g., PE  or EDLIN).  They
  289.             CANNOT be  created  in  BitCom.    You  can  use  your  word
  290.             processor if it can create text, or ASCII, files.
  291.             
  292.             The  text   in  these   files  may   consist  of  assignment
  293.             statements, conditional  statements,  branching  statements,
  294.             and function  calls.   Comments may  be placed anywhere in a
  295.             file by  surrounding the  comment with  opening and  closing
  296.             braces ('{' and '}').  Comments must always begin and end on
  297.             the same line.
  298.             
  299.             Also, upper/lower  case assignments  are ignored (except for
  300.             strings being  sent to  the host  or typed at the terminal).
  301.             For example, 'Bell' = 'BELL' = 'bell'.
  302.             
  303.             Normally, in your ACTION file, you will place each statement
  304.             on  a   single  line.    However,  you  may  place  multiple
  305.             statements on  a single  line by  separating each  statement
  306.             with a  semi-colon ';'.   If  you only  have one command per
  307.             line, the semi-colon at the end of each line is optional.
  308.             
  309.             Reserved Symbols
  310.             ----------------
  311.             Certain symbols  are reserved in BitCom as they have special
  312.             meanings.  If you wish to use any of these symbols in a text
  313.             message, it is necessary to place two of them in a row.  For
  314.             example, if  you wish  to use the @ symbol in a message, you
  315.             would use  "@@".   The symbols  and their  meanings  are  as
  316.             follows:
  317.             
  318.  
  319.  
  320.                                                                        7
  321.  
  322.  
  323.  
  324.             Symbol    Name                Meaning
  325.             ------    ----                -------
  326.             ;         Semi-colon          Ends one command and begins
  327.                                           another
  328.             
  329.             $         Dollar sign         Beginning of a hex value
  330.             
  331.             (         Open                Beginning of an argument
  332.                       Parentheses
  333.             
  334.             )         Close               Ending of an argument
  335.                       Parentheses
  336.             
  337.             \         Back slash          Beginning of a decimal value
  338.             
  339.             @         At sign             Beginning of a builtin
  340.                                           variable
  341.             
  342.             =         Equals              Equal for comparison
  343.             
  344.             >         Greater than        Greater than for comparison
  345.             
  346.             <         Less than           Less than for comparison
  347.             
  348.             <>        Not equal to        Not equal to for comparison
  349.             
  350.             +         Plus                Addition
  351.             
  352.             *         Asterisk            Multiplication
  353.             
  354.             -         Hyphen              Subtraction
  355.             
  356.             "         Double quote        Beginning and ending of
  357.                                           text (strings)
  358.             
  359.             '         Single quote        Beginning and ending of the
  360.                                           assignment of key variables
  361.             
  362.             {         Open brace          Beginning of comments
  363.             
  364.             }         Closed brace        Ending of comments
  365.             
  366.  
  367.  
  368.                                                                        8
  369.  
  370.  
  371.  
  372.             Variables
  373.             ---------
  374.             Variables are  similar to  a storage place, or cell, that is
  375.             used in the BitCom language to store information.  There are
  376.             several types  of variables  which can be used in the BitCom
  377.             language.   "Scratch" variables  may be assigned a value for
  378.             later use.   "Argument"  variables contain the values of any
  379.             arguments passed  on to  a command  file.   "Key"  variables
  380.             allow you to assign values to, as well as invoke files with,
  381.             special keys.   And "Builtin" variables allow you to set and
  382.             query various BitCom values.
  383.             
  384.             All variables  begin with the special character '@' followed
  385.             by the  name of  the variable.   Note  that if  you need  to
  386.             include the  character '@' in a command file, you must do so
  387.             with two @  characters together (i.e. @@).
  388.             
  389.             Scratch Variables
  390.             -----------------
  391.             There are  26 scratch  variables that can be used to contain
  392.             work values.  These variables are named @A through @Z.
  393.             
  394.             Scratch variables  are useful  for saving  values, and  then
  395.             changing the value later in the file.
  396.             
  397.             Argument Variables
  398.             ------------------
  399.             When a  SCRIPT or  ACTION file  is invoked, arguments may be
  400.             passed on  to it.   The  argument may  be referred to in the
  401.             file with the names @1 through @9 which represents arguments
  402.             1 through  9.   A maximum  of 9  arguments may  be contained
  403.             within one  file.   You may  NOT assign  values to  argument
  404.             variables.   These can be used whether you invoke the script
  405.             file from DOS, or from the menu.
  406.             
  407.             Key Variables
  408.             -------------
  409.             Key variables allow you to:
  410.             
  411.             1)   Assign functions such as SENDFILE to a key.
  412.             
  413.             2)   Assign  an  escape  sequence  to  a  key  for  terminal
  414.                  emulation.
  415.             
  416.             3)   Invoke another action file by pressing a key.
  417.             
  418.             4)   Assign a string of text to a key.
  419.             
  420.             Key variables  are the  names of  the special  keys  on  the
  421.             keyboard.  Every special key has a unique name, and a string
  422.             may be  assigned to those keys.  That function would then be
  423.             executed when the assigned key is pressed.
  424.  
  425.  
  426.                                                                        9
  427.  
  428.  
  429.  
  430.             
  431.             If a  key variable  is used by itself in a statement, BitCom
  432.             will perform  that function  as if  the key  itself had been
  433.             pressed.
  434.             
  435.             The valid key variables are:
  436.             
  437.             @F1            @Alt-A         @Ctl-A         @Alt-F1
  438.             @F2            @Alt-B         @Ctl-B         @Alt-F2
  439.             @F3            @Alt-C         @Ctl-C         @Alt-F3
  440.             @F4            @Alt-D         @Ctl-D         @Alt-F4
  441.             @F5            @Alt-E         @Ctl-E         @Alt-F5
  442.             @F6            @Alt-F         @Ctl-F         @Alt-F6
  443.             @F7            @Alt-G         @Ctl-G         @Alt-F7
  444.             @F8            @Alt-H         @Ctl-H         @Alt-F8
  445.             @F9            @Alt-I         @Ctl-I         @Alt-F9
  446.             @F10           @Alt-J         @Ctl-J         @Alt-F10
  447.             @Home          @Alt-K         @Ctl-K         @Sft-F1
  448.             @End           @Alt-L         @Ctl-L         @Sft-F2
  449.             @Break         @Alt-M         @Ctl-M         @Sft-F3
  450.             @BS            @Alt-N         @Ctl-N         @Sft-F4
  451.             @Rtab          @Alt-O         @Ctl-O         @Sft-F5
  452.             @Lfeed         @Alt-P         @Ctl-P         @Sft-F6
  453.             @Return        @Alt-Q         @Ctl-Q         @Sft-F7
  454.             @PgUp          @Alt-R         @Ctl-R         @Sft-F8
  455.             @PgDn          @Alt-S         @Ctl-S         @Sft-F9
  456.             @Ins           @Alt-T         @Ctl-T         @Sft-F10
  457.             @Del           @Alt-U         @Ctl-U         @Ctl-F1
  458.             @Esc           @Alt-V         @Ctl-V         @Ctl-F2
  459.             @LfArr         @Alt-W         @Ctl-W         @Ctl-F3
  460.             @RiArr         @Alt-X         @Ctl-X         @Ctl-F4
  461.             @UpArr         @Alt-Y         @Ctl-Y         @Ctl-F5
  462.             @DnArr         @Alt-Z         @Ctl-Z         @Ctl-F6
  463.             @Ltab          @CtlHome       @CtlEnd        @Ctl-F7
  464.             @CtlPgUp       @CtlPgDn       @CtlLeft       @Ctl-F8
  465.             @CtlRight      @Ctlprt        @Altdsh        @Ctl-F9
  466.             @Alteq         @Alt-1         @Alt-2         @Ctl-F10
  467.             @Alt-3         @Alt-4         @Alt-5         @Alt-6
  468.             @Alt-7         @Alt-8         @Alt-9         @Alt-0
  469.             
  470.  
  471.  
  472.                                                                        10
  473.  
  474.  
  475.  
  476.             Also, the  following keys  on  the  numeric  keypad  may  be
  477.             defined:
  478.             
  479.             @Ctlret        Control Return
  480.             @NL-0          Numeric Keypad 0
  481.             @NL-1          Numeric Keypad 1
  482.             @NL-2          Numeric Keypad 2
  483.             @NL-3          Numeric Keypad 3
  484.             @NL-4          Numeric Keypad 4
  485.             @NL-5          Numeric Keypad 5
  486.             @NL-6          Numeric Keypad 6
  487.             @NL-7          Numeric Keypad 7
  488.             @NL-8          Numeric Keypad 8
  489.             @NL-9          Numeric Keypad 9
  490.             @NL-Dsh        Numeric Keypad -
  491.             @NL-Pls        Numeric Keypad +
  492.             @NL-Dot        Numeric Keypad .
  493.             
  494.             To assign  a value  to a  key, you  would give an assignment
  495.             statement such as:
  496.             
  497.                  @alt-S='"a string"';
  498.             
  499.             The single quotes surrounding the text indicate that what is
  500.             contained within them is assigned to the key variable in the
  501.             statement.   The double quotes indicate that the text within
  502.             the quotes  is a  string that  will  be  sent  to  the  host
  503.             computer.
  504.             
  505.             You may also invoke the key (as if you had pressed it at the
  506.             keyboard) by  giving the  name of  the key as a statement by
  507.             itself, such as:
  508.             
  509.                  @Return;
  510.             
  511.             If it is not in quotes, however, it will not be sent through
  512.             the port.
  513.             
  514.             You cannot  use a key variable to perform a function that it
  515.             normally would  manually.   For instance, the special key to
  516.             Print is  <F4>.   You would  use the  function PRINTER(1) to
  517.             enable printing, rather than the key variable of @F4.
  518.             
  519.             Builtin Variables
  520.             -----------------
  521.             There are  other variables defined that allow you to inquire
  522.             about, set  and/or retrieve  certain information from BitCom
  523.             screens.   These parameters  are usually  set on  the BitCom
  524.             menus, however, these variables allow you to see and set the
  525.             various parameters  in various  screens without entering the
  526.             menus.   The variables  are given here, along with the field
  527.             type that each refers to, and a definition.
  528.  
  529.  
  530.                                                                        11
  531.  
  532.  
  533.  
  534.             
  535.             These variables  can be combined inside a function.  See the
  536.             IF command  later in  this section  as an  example.    Those
  537.             variables with  an asterisk  next to  their type may only be
  538.             used in a script file, not an action file.
  539.             
  540.             Name           Type           Contents
  541.             ----           ----           --------
  542.             @Autofil       String         Name of automatic logon file
  543.             @Autolf        Number         Auto linefeed filter, 0=off,
  544.                                           1=on
  545.             @Baud          Number         Current baud rate
  546.             @Bell          Number         Current bell setting; 0=off,
  547.                                           1=short beep, 2=long beep, and
  548.                                           3=long warble
  549.             @BlankLn       Number         Blank line filter, 0=off, 1=on
  550.             @BreakT        Number         Number of hsecs that a break
  551.                                           should last
  552.             @Capmode       Number         Capture mode, 0=Replace,
  553.                                           1=Append
  554.             @Capname       String         Name of capture file
  555.             @Cdate         String         Current date shown in the
  556.                                           format 'mm/dd/yy'
  557.             @Col           Number         Current cursor column location
  558.             @Comport       String*        COMM port, 1=COM1, 2=COM2,
  559.                                           3=COM3, 4=COM4
  560.             @Conn          Number*        Connection status, 0=not
  561.                                           connected, 1=connected,
  562.                                           2=dialed line busy
  563.             @Crec          Number         Current record number
  564.             @Csend         Number         Character delay,1=wait for
  565.                                           echo, 0=none, or number of
  566.                                           hsecs to wait
  567.             @Ctime         String         Current time shown in format
  568.                                           'hh:mm am/pm'
  569.             @Data          Number         Number of data bits
  570.             @Desc          String         Current record description
  571.             @Dldir         String         Sub-directory that files will
  572.                                           be down-loaded to.  Shown as
  573.                                           @DLDIR='name' where name is
  574.                                           the sub-directory name
  575.             @Echo          Number         0=no echo, 1=echo on
  576.             @Emulate       Number         Emulation file name, without
  577.                                           extension
  578.             @Exptab        Number         Expand tab filter; 0=off,1=on
  579.             @Input         Number         Input filter, 0=off, 1=on
  580.             @Ldate         String         Last connect date shown in the
  581.                                           format 'mm/dd/yy'
  582.             @Lsend         Number         Line delay, 2=manual,
  583.                                           1=wait for line feed, 0=none,
  584.                                           or number of hsecs to wait
  585.  
  586.  
  587.                                                                        12
  588.  
  589.  
  590.  
  591.             Name           Type           Contents
  592.             ----           ----           --------
  593.             @Ltime         String         Last connect time shown in
  594.                                           format 'hh:mm am/pm'
  595.             @Maxrow        Number         The number of rows on your
  596.                                           monitor, usually 25.  If a
  597.                                           graphics card is switched to
  598.                                           44 rows, must change @Maxrow
  599.                                           to 44.
  600.             @Mcol          Number         Maximum number of columns on
  601.                                           the current screen
  602.             @Mode          Number*        0=Answer, 1=Dial
  603.             @Mrow          Number         Maximum number of rows on the
  604.                                           current window.  Must be less
  605.                                           than @Maxrow.
  606.             @Note1         String         First line of notes
  607.             @Note2         String         Second line of notes
  608.             @Output        Number         Output filter, 0=off, 1=on
  609.             @Parity        String         N=None, E=Even, O=Odd, M=Mark
  610.             @Phone         String         Current phone number
  611.             @Recid         String         Current record Id
  612.             @Redial        Number         Number of seconds to wait
  613.                                           between redials, shown in
  614.                                           seconds
  615.             @Row           Number         Current cursor row number
  616.             @Stop          Number         Number of stop bits
  617.             @Trace         Number         0=trace off, 1=hex, 2=ASCII
  618.             @Upcase        Number         Upper case filter, 0=off, 1=on
  619.             
  620.             Constants
  621.             ---------
  622.             Constants can  be used  to compare  with and  set variables.
  623.             They can be either numbers or strings of characters (text).
  624.             
  625.             Numbers can  be given  as simple  integers only,  optionally
  626.             preceded by  a sign  character.   There are  three types  of
  627.             strings that can be given:
  628.             
  629.             Those enclosed in double quotes (")
  630.             
  631.             Those enclosed in single quotes (')
  632.             
  633.             Those enclosed in no quotes at all.
  634.             
  635.             Strings enclosed  in double  quotes (called a d-string) must
  636.             be preceded  and followed by a double quote (").  To specify
  637.             a string  containing a  double quote,  therefore,  you  must
  638.             specify two double quotes ("") in a row.
  639.             
  640.  
  641.  
  642.                                                                        13
  643.  
  644.  
  645.  
  646.             A string enclosed in single quotes (called an s-string) must
  647.             be preceded  and followed  by a  single quote.    Again,  to
  648.             specify an  s-string containing  a single quote, specify two
  649.             in a row.
  650.             
  651.             In a  d-string, if  a variable  name is  found in the string
  652.             (e.g.   @1) the variable will be substituted with its value.
  653.             Text which  is enclosed in double quotes will be sent to the
  654.             host computer.  If you wish to immediately follow a variable
  655.             with a  non-blank character, you must follow the name of the
  656.             variable with a period.  That period will be stripped off of
  657.             the resulting  string.   Thus, if  @a has  been assigned the
  658.             value "def", as in the example:
  659.             
  660.                  @a = "def"
  661.             
  662.             then:
  663.             
  664.                  "@a" is "def"
  665.                  "abc@a" is "abcdef"
  666.                  "abc@a.ghi" is "abcdefghi"
  667.             
  668.             Note that  if a  d-string contains a variable name for which
  669.             no value  has been defined, the variable will be substituted
  670.             with a null string.  No error message will be displayed.  To
  671.             include an  at-sign (@)  in a d-string, specify two @'s in a
  672.             row (e.g. @@).
  673.             
  674.             A d-string  may also  contain the hexadecimal representation
  675.             of a  character.   This is often useful when sending special
  676.             characters to  the host  computer, or  when searching  for a
  677.             special character.   Specify  the hexadecimal  character  as
  678.             "$xx" where  the 'xx'  is in the range of 0-9 and A-FF.  For
  679.             example, the  line feed  character would  be shown as "$0A".
  680.             As usual,  specify two  $'s in  a row  to actually include a
  681.             dollar sign ($) in a string.
  682.             
  683.             With an  s-string, no variable substitution will take place.
  684.             This is  useful when  assigning strings to function keys for
  685.             later evaluation.
  686.             
  687.             Examples of valid constants are:
  688.             
  689.             "This is a d-string"
  690.             "This is a d-string with a double quote ("") in it"
  691.             'This is  an s-string  with a  double quote  (") and  single
  692.             quote ('')'
  693.             
  694.             Also, if  you wish  to give a string containing no blanks in
  695.             it, you  may omit  the quotes  (i.e. specifying "ABC" is the
  696.             same as ABC).
  697.             
  698.  
  699.  
  700.                                                                        14
  701.  
  702.  
  703.  
  704.             Statements
  705.             ----------
  706.             BitCom uses  four types  of statements.   They  are variable
  707.             statements,  assignment  statements,  procedure  calls,  and
  708.             control statements.   Statements  may be  separated  with  a
  709.             semi-colon (;)  to place  more than one statement on a line.
  710.             The semi-colon  is optional  if the  line only  contains one
  711.             command.
  712.             
  713.             Variable Statements
  714.             -------------------
  715.             A variable statement consists of one of the following:
  716.             
  717.             1.   The name of a variable (e.g. @1 or @a)
  718.             2.   A constant string or numeric value
  719.             3.   The name of a key variable
  720.             
  721.             In the  first two  instances, the  resulting string  of  the
  722.             variable constant  is SENT  to the  communications  port  as
  723.             though you  had typed  the string  at the  keyboard.  If the
  724.             variable had  contained a  numeric value,  the  string  that
  725.             would represent the number is sent (i.e. 200 = "200").
  726.             
  727.             In the  third case  shown above, if a key variable is given,
  728.             then   the action will be taken if an ACTION string has been
  729.             assigned to  that key.   Otherwise the value of the key will
  730.             be sent to the communications port as though you had pressed
  731.             that key  at the  keyboard.  Note, however, that the special
  732.             keys (Help, Confirm,  etc.) cannot be invoked this way.  For
  733.             example,
  734.             
  735.             "logid";@return; {sends "logid" followed by carriage return}
  736.             @a;  {sends keystrokes defined in string assigned}
  737.             @1;  {sends string in argument 1}
  738.             
  739.             Assignment Statements
  740.             ---------------------
  741.             An assignment  statement is  used to  assign a  value  to  a
  742.             variable.  It would look like this:
  743.             
  744.                  variable = value;
  745.             
  746.             The variable  may be  any valid  builtin function  described
  747.             earlier in  this chapter.  The value may be either a number,
  748.             a  d-string,  an  s-string,  another  variable  name,  or  a
  749.             function name.  Examples of valid assignments are:
  750.             
  751.                  @baud=1200
  752.                  @Note1="We tried to connect at @Cdate";
  753.                  @Alt-s='sendfile("prompt("Send File Name?")","Xmodem")'
  754.             
  755.  
  756.  
  757.                                                                        15
  758.  
  759.  
  760.  
  761.             Note that  the last example defines the @Alt-S key to prompt
  762.             for a filename, and then begin sending that file.
  763.             
  764.             Function Calls
  765.             --------------
  766.             There are  many BitCom  functions which  may be  invoked  to
  767.             perform a  variety of tasks.  These functions are invoked by
  768.             giving  the   function  name.     Some   functions  are  not
  769.             conditional, and  therefore do  not require  any  arguments.
  770.             Any arguments  the function does require must be enclosed in
  771.             the left and right parenthesis and separated by commas.
  772.             
  773.             These functions  always return  a value  which is either the
  774.             result of  the function  or a  return  code  indicating  the
  775.             success or failure of the task.
  776.             
  777.             These functions  will be  described in  detail later in this
  778.             section.
  779.             
  780.             The next  section will provide you with detailed information
  781.             of the  functions available  in the BitCom program language.
  782.             As explained  earlier, BitCom uses constants, variables, and
  783.             statements to perform functions that you frequently use.
  784.             
  785.             BitCom  script  commands  can  be  written  using  any  word
  786.             processor that  creates text  files.  If you are not sure if
  787.             your word  processor does  this, create a sample file.  From
  788.             the DOS  prompt, use  the TYPE  command to display the file.
  789.             You should  only see  the text  that you have typed in.  You
  790.             should not  see strange  looking or  graphics characters.  A
  791.             BitCom program  CANNOT be  written while  using BitCom.  You
  792.             must use a word processor or text editor.
  793.             
  794.             The functions  explained in  this section  can be  used  for
  795.             terminal emulation, as well as SCRIPT and ACTION files.
  796.             
  797.             Upper/lower  case   of  the   functions  and   commands   is
  798.             insignificant in  setting up  these files.  That is, whether
  799.             you type  commands in  upper or  lower case has no effect on
  800.             the command itself.  However, case is important when waiting
  801.             for a particular string, such as in the CWAIT function.
  802.             
  803.             The functions  in this  chapter are arranged alphabetically.
  804.             With each  function, there  will be five parts: the function
  805.             name, the  type of function, the syntax that should be used,
  806.             the purpose  for the  function, and  an example of how it is
  807.             used.
  808.             
  809.             The following  is a  list of  commands arranged according to
  810.             their function.
  811.             
  812.  
  813.  
  814.                                                                        16
  815.  
  816.  
  817.  
  818.             Conditional         String Handling     File Handling
  819.             -----------         ---------------     -------------
  820.             IF                  CONCAT              CAPTURE
  821.             ELSE                SUBSTR
  822.             
  823.             
  824.             Branching           Port I/O            Miscellaneous
  825.             ---------           --------            -------------
  826.             ABORT               EXIST               BELL
  827.             CANCEL              GETCH               DOS
  828.             EXIT                GETCHW              EXPR
  829.             GOTO                GETLINE             PRINTER
  830.             INVOKE              SBREAK              PROMPT
  831.                                                     TRACE
  832.             
  833.             
  834.             Display I/O         File Transfer       Event Wait
  835.             -----------         -------------       ----------
  836.             CLEAR               BPLUS               CWAIT
  837.             CLOCK               KEREND              TWAIT
  838.             CURSIZE             KERGET              WAIT
  839.             HELPLINE            KERRECV             WWAIT
  840.             MESSAGE             KERSEND
  841.             POSCUR              RECVFILE            Flags & Switches
  842.             SETCOLOR            SENDFILE            ----------------
  843.             TYPE                                    CHRMAP
  844.             TYPECR
  845.             
  846.                                 Connection
  847.                                 ----------
  848.                                 DOCOMM
  849.                                 HANGUP
  850.                                 SELECT
  851.  
  852.  
  853.                                                                        17
  854.  
  855.  
  856.  
  857.             FUNCTION: ABORT                              TYPE: BRANCHING
  858.             
  859.             SYNTAX:   ABORT
  860.             
  861.             PURPOSE:  This function  will stop  all processing, and exit
  862.                       BitCom to  DOS.  It will leave the line connected,
  863.                       allowing you  to use  other programs  that talk to
  864.                       the modem.   This  is helpful  if you have another
  865.                       program, such  as  a  database  that  you  use  to
  866.                       communicate after  you are  connected, and you are
  867.                       only using BitCom to make the connection.
  868.             
  869.             EXAMPLE:  In this  example, you  would exit  BitCom, leaving
  870.                       the line  connected, after  a connection  has been
  871.                       established.
  872.             
  873.                       SELECT("EASYLINK")
  874.                       DOCOMM
  875.                       :LOOP
  876.                       IF (@CONN=1) GOTO :DONE
  877.                       TWAIT(2,"SEC")
  878.                       GOTO :LOOP
  879.                       :DONE
  880.                       ABORT
  881.             ____________________________________________________________
  882.             
  883.             FUNCTION: BELL                       TYPE: MISCELLANEOUS I/O
  884.             
  885.             SYNTAX:   BELL
  886.             
  887.             PURPOSE:  This  function   is  used  to  sound  the  speaker
  888.                       (depending   upon the current bell setting).  This
  889.                       function can  be used  in SCRIPT  or ACTION files,
  890.                       and will always return a zero.
  891.             
  892.             EXAMPLE:  In the  SCRIPT file  DIAL.SCP,  the  label  :didit
  893.                       shows:
  894.             
  895.                       @bell = 3;     {set bell sound to long warble}
  896.                       bell;          {beep the speaker}
  897.                       @bell = 1;     {set bell sound to short beep}
  898.             
  899.                       In the following example, the bell will be sounded
  900.                       after a file is received.
  901.             
  902.                       RECVFILE("PROMPT("ENTER FILE NAME")","XMODEM")
  903.                       BELL
  904.             
  905.             
  906.  
  907.  
  908.                                                                        18
  909.  
  910.  
  911.  
  912.             FUNCTION: BPLUS                          TYPE: FILE TRANSFER
  913.             
  914.             SYNTAX:   BPLUS("SEND")
  915.                       BPLUS("RECEIVE")
  916.             
  917.             PURPOSE:  This function  is used  to send  or receive  files
  918.                       using the CompuServe B+ protocol.  The filename is
  919.                       not necessary,  as it  is picked  up from the host
  920.                       computer.
  921.             
  922.             EXAMPLE:  In this  example, you  would receive  a file using
  923.                       the CompuServe B+ protocol.
  924.             
  925.                       BPLUS("RECEIVE")
  926.             ____________________________________________________________
  927.             
  928.             FUNCTION: CANCEL                             TYPE: BRANCHING
  929.             
  930.             SYNTAX:   CANCEL[(MESSAGE)]
  931.             
  932.             PURPOSE:  To cancel  the processing of all command files and
  933.                       return  to   the  keyboard  state.    The  message
  934.                       argument is  optional.   It can  be a  string or a
  935.                       variable name.   If  the message  is included,  it
  936.                       will be  shown on  your screen  when the system is
  937.                       returned to the keyboard state.
  938.             
  939.             EXAMPLE:  In this  example, if  a file  was not  found,  the
  940.                       processing of  the command  file will stop and you
  941.                       will be returned to the normal keyboard state.
  942.             
  943.                       IF (EXIST("COMMAND.COM")=0) GOTO :BADFILE
  944.                       :BADFILE
  945.                       "File Not Found$0d$0a";
  946.                       cancel
  947.             
  948.                       Note that the CANCEL command does not stop or exit
  949.                       BitCom, but  merely stops  the processing  of  the
  950.                       SCRIPT/ACTION file.
  951.             
  952.             
  953.  
  954.  
  955.                                                                        19
  956.  
  957.  
  958.  
  959.             FUNCTION: CAPTURE                        TYPE: FILE HANDLING
  960.             
  961.             SYNTAX:   CAPTURE(1)
  962.                       CAPTURE(0)
  963.             
  964.             PURPOSE:  This function will begin or end the capturing of a
  965.                       file during communications.  Capture(1) will begin
  966.                       the capturing of a file, while Capture(0) will end
  967.                       the capturing of the file.
  968.             
  969.             EXAMPLE:  This example  will begin  the capturing  of a file
  970.                       after a connection is made.
  971.             
  972.                       IF(@CONN=1) CAPTURE(1)
  973.             
  974.                       The following  example will  stop capturing  after
  975.                       "PTS" is received.
  976.             
  977.                       CWAIT("PTS")
  978.                       CAPTURE(0)
  979.             
  980.                       Note that  the Communications Parameters Menu must
  981.                       contain  a   Capture  Filename   when  you   begin
  982.                       communications.
  983.             ____________________________________________________________
  984.             
  985.             FUNCTION: CHRMAP                    TYPE: FLAGS AND SWITCHES
  986.             
  987.             SYNTAX:   CHRMAP(0)
  988.                       CHRMAP(1)
  989.             
  990.             PURPOSE:  This command  enables/disables character filtering
  991.                       and emulation.   Character  filtering tells BitCom
  992.                       to ignore and discard control characters when they
  993.                       are received from the host.
  994.             
  995.                       CHRMAP(0) disables  the  character  filtering  and
  996.                       emulation,  while   CHRMAP(1)  enables   character
  997.                       filtering.   If you  are using terminal emulation,
  998.                       character  filtering   will  be  enabled  and  the
  999.                       INBUFFER section  of the emulation file determines
  1000.                       which  characters   are   to   be   filtered   and
  1001.                       translated.
  1002.             
  1003.                       By using  CHRMAP(0), you  can temporarily  disable
  1004.                       emulation and  allow all  control characters to be
  1005.                       displayed on the screen.  They will also be echoed
  1006.                       to the  printer if the print function is on.  This
  1007.                       function is especially useful if you want to print
  1008.                       a formatted  file while receiving it from the host
  1009.                       computer.
  1010.             
  1011.  
  1012.  
  1013.                                                                        20
  1014.  
  1015.  
  1016.  
  1017.             EXAMPLE:  CHRMAP(0)      {DISABLED}
  1018.                       CHRMAP(1)      {ENABLED}
  1019.             
  1020.                       Note:   After you  have disabled the character map
  1021.                       filtering, make  sure that  you enable it again so
  1022.                       that your terminal emulation will work correctly.
  1023.             ____________________________________________________________
  1024.             
  1025.             FUNCTION: CLEAR                            TYPE: DISPLAY I/O
  1026.             
  1027.             SYNTAX:   CLEAR
  1028.             
  1029.             PURPOSE:  This function  is used to clear the display screen
  1030.                       on your PC (but not on the remote PC).
  1031.             
  1032.             EXAMPLE:  This statement will assign the function of 'clear'
  1033.                       to the  key variable  of @alt-z.   When  ALT-Z  is
  1034.                       pressed, the screen will clear.
  1035.             
  1036.                       @ALT-Z = '{Clear Screen} clear'
  1037.             
  1038.                       See also the command SETCOLOR.
  1039.             ____________________________________________________________
  1040.             
  1041.             FUNCTION: CLOCK                            TYPE: DISPLAY I/O
  1042.             
  1043.             SYNTAX:   CLOCK(0)
  1044.                       CLOCK(1)
  1045.             
  1046.             PURPOSE:  This function  is used  to turn  the Connect clock
  1047.                       display on or off.  The Connect clock is displayed
  1048.                       in  the   lower  right   corner  of   the  screen.
  1049.                       Normally,  the   display  will  be  on  after  the
  1050.                       "CONNECT" message is received from the modem.
  1051.             
  1052.             EXAMPLE:  This example  will assign the functions of turning
  1053.                       the connect  clock display  on and off to function
  1054.                       keys.
  1055.             
  1056.                       @Alt-F1='CLOCK(1) {TURN CLOCK ON}
  1057.                       @Alt-F2='CLOCK(0) {TURN CLOCK OFF}
  1058.             
  1059.             
  1060.  
  1061.  
  1062.                                                                        21
  1063.  
  1064.  
  1065.  
  1066.             FUNCTION: CONCAT                       TYPE: STRING HANDLING
  1067.             
  1068.             SYNTAX:   CONCAT(arg1,arg2)
  1069.             
  1070.             PURPOSE:  Used to  concatenate argument  2 to argument 1 and
  1071.                       return the result.
  1072.             
  1073.             EXAMPLE:  @R = concat(@a,@b)
  1074.             
  1075.                       The string  in variable  @b  is  appended  to  the
  1076.                       string in  variable @a.  The result will be stored
  1077.                       in @R.   If @a is "How are you" and @b is "today",
  1078.                       then @R  will contain  the  string  "How  are  you
  1079.                       today."
  1080.             ____________________________________________________________
  1081.             
  1082.             FUNCTION: CURSIZE                          TYPE: DISPLAY I/O
  1083.             
  1084.             SYNTAX:   CURSIZE(start_line,end_line)
  1085.             
  1086.             PURPOSE:  This function  is used  to change  the size of the
  1087.                       cursor according  to the  arguments of  start_line
  1088.                       and end_line.
  1089.             
  1090.                       The IBM  PC cursor is made up of scan lines from 1
  1091.                       to 10,  depending upon  the  graphics  card  being
  1092.                       used.   Normally, Hercules  and  compatible  cards
  1093.                       have scan  lines from 1 to 13, CGA cards have from
  1094.                       1 to  7, and  EGA cards  have from  1 to  8.   The
  1095.                       start_line argument  is the  top scan  line of the
  1096.                       cursor.   The end_line  argument is  the last scan
  1097.                       line of the cursor.  If the start_line argument is
  1098.                       greater than  the end_line  argument,  the  cursor
  1099.                       will  be  turned  off,  and  not  visible  on  the
  1100.                       display.
  1101.             
  1102.             EXAMPLE:  For  example,   the  following  are  various  size
  1103.                       cursors that can be used with an EGA monitor.
  1104.             
  1105.                       CURSIZE(0,8)   {FULL SIZE CURSOR}
  1106.                       CURSIZE(4,8)   {HALF SQUARE SIZE}
  1107.                       CURSIZE(7,8)   {NORMAL CURSOR}
  1108.                       CURSIZE(9,9)   {TURN OFF CURSOR}
  1109.             
  1110.  
  1111.  
  1112.                                                                        22
  1113.  
  1114.  
  1115.  
  1116.                       You can  also assign  the cursor size to a key, so
  1117.                       that it  can be  changed while  you are connected.
  1118.                       For example,  the following  lines can be added to
  1119.                       your script or action file.
  1120.             
  1121.                       @alt-f='cursize(0,8)'{full size, EGA monitor}
  1122.                       @alt-m='cursize(3,8)'{half size, EGA monitor}
  1123.                       @alt-n='cursize(7,8)'{normal, EGA monitor}
  1124.                       @alt-o='cursize(9,9)'{turn off EGA cursor}
  1125.                       @alt-l='cursize(1,13)'{full size, mono monitor}
  1126.                       @alt-p='cursize(6,13)'{half size, mono monitor}
  1127.                       @alt-q='cursize(12,13)'{normal, mono monitor}
  1128.                       @alt-u='cursize(32,13)'{turn off mono cursor}
  1129.             ____________________________________________________________
  1130.             
  1131.             FUNCTION: CWAIT                             TYPE: EVENT WAIT
  1132.             
  1133.             SYNTAX:   CWAIT(string)
  1134.             
  1135.             PURPOSE:  This function is used to wait for the given string
  1136.                       from the  host.  It will always return a zero.  If
  1137.                       the given  string is  never matched,  BitCom  will
  1138.                       continue to wait until you press the "Halt" key.
  1139.             
  1140.             EXAMPLE:  If you  want to  wait for  a prompt  of a question
  1141.                       mark (?) this can be done with the statement:
  1142.             
  1143.                       CWAIT("?");
  1144.                       CWAIT("PLEASE LOG ON")
  1145.             
  1146.                       Note:  The string can be anywhere within a line or
  1147.                       lines.   It is  suggested that  you find  a unique
  1148.                       phrase or  string to  wait for.   The  string that
  1149.                       this function waits for must match the string sent
  1150.                       from the  host  computer  exactly.    It  is  case
  1151.                       sensitive.   For example "log on" and "LOG ON" are
  1152.                       not the same string.
  1153.             ____________________________________________________________
  1154.             
  1155.             FUNCTION: DOCOMM                            TYPE: CONNECTION
  1156.             
  1157.             SYNTAX:   DOCOMM
  1158.             
  1159.             PURPOSE:  This function will begin communications, using the
  1160.                       current value of @MODE.  If @MODE=0, the system is
  1161.                       set up  for auto  answer.  If @MODE=1, the current
  1162.                       number  shown  in  @PHONE  will  be  dialed.    If
  1163.                       @MODE=2, it  is assumed  that there  is  a  direct
  1164.                       connection (i.e.  not  through  a  modem).    This
  1165.                       function can  only be  used in  a script file.  It
  1166.                       cannot be  used until the SELECT function has been
  1167.                       used, nor can it be used in an action file.
  1168.  
  1169.  
  1170.                                                                        23
  1171.  
  1172.  
  1173.  
  1174.             
  1175.             EXAMPLE:  The following example selects a record (EASYLINK),
  1176.                       dials the number and checks for a connection.  The
  1177.                       loop testing for a valid connection must always be
  1178.                       used after the DOCOMM function.
  1179.             
  1180.                       SELECT("EASYLINK")
  1181.                       DOCOMM
  1182.                       :LOOP
  1183.                       IF(@CONN=1)GOTO :DONE
  1184.                       TWAIT(2,"SEC")
  1185.                       GOTO :LOOP
  1186.                       :DONE
  1187.             
  1188.                       The DOCOMM command will return to the next line of
  1189.                       the script  file immediately.   You  must use  the
  1190.                       "IF" statement  to check if the line has connected
  1191.                       as shown  in the  example above.   The  loop  must
  1192.                       contain the two second TWAIT statement to give the
  1193.                       modem time to connect.
  1194.             
  1195.                       The  DOCOMM  command  functions  as  if  you  were
  1196.                       pressing   the    CONFIRM   key   while   at   the
  1197.                       Communications Selection Menu.
  1198.             ____________________________________________________________
  1199.             
  1200.             FUNCTION: DOS                            TYPE: MISCELLANEOUS
  1201.             
  1202.             SYNTAX:   DOS(string)
  1203.             
  1204.             PURPOSE:  This function will issue the given string as a DOS
  1205.                       command.  It will always return a zero.
  1206.             
  1207.  
  1208.  
  1209.                                                                        24
  1210.  
  1211.  
  1212.  
  1213.             EXAMPLE:  This example  will issue  the SETMODE command as a
  1214.                       DOS command  to change the display to a 132 column
  1215.                       by 44  row display,  and assign these functions to
  1216.                       the key variable of @ALT-X.
  1217.             
  1218.             @ALT-X='{132 mode} dos("setmode -ammono -C132 -44 -mmon")'
  1219.             
  1220.                       The following  example will  invoke the  DOS  file
  1221.                       COMMAND.COM and  give you the real DOS prompt.  To
  1222.                       return to  BitCom, you  would type:  EXIT and then
  1223.                       press <ENTER>.
  1224.             
  1225.                       DOS("COMMAND.COM")
  1226.                       
  1227.                       Also, you  may  put  more  than  one  DOS  command
  1228.                       together by  the use  of the  pound sign (#).  For
  1229.                       example:
  1230.             
  1231.                       DOS("DIR#PAUSE")
  1232.             
  1233.                       This would  first run  a directory  and then pause
  1234.                       until you  press a key before returning you to the
  1235.                       communications screen.
  1236.             ____________________________________________________________
  1237.             
  1238.             FUNCTION: ELSE                           TYPE: MISCELLANEOUS
  1239.             
  1240.             SYNTAX:   See IF command for details
  1241.             ____________________________________________________________
  1242.             
  1243.             FUNCTION: EXIST                               TYPE: PORT I/O
  1244.             
  1245.             SYNTAX:   EXIST(filename)
  1246.             
  1247.             PURPOSE:  This function  is used to see if a filename exists
  1248.                       on the disk.  If the file does exist, the function
  1249.                       will return  a 1.  If the file does not exist, the
  1250.                       function will  return a  0.  The filename argument
  1251.                       cannot contain wild card characters.
  1252.             
  1253.  
  1254.  
  1255.                                                                        25
  1256.  
  1257.  
  1258.  
  1259.             EXAMPLE:  In this  example taken  from the  file ANSWER.ACT,
  1260.                       the line that is typed is a filename which is then
  1261.                       assigned to  the scratch  variable @a.   The  next
  1262.                       line checks to see if the filename exists with the
  1263.                       EXIST function.
  1264.             
  1265.                       @a = getline
  1266.                       @b = exist(@a)
  1267.                       if (@b=0) "File Does Not Exist"
  1268.             
  1269.                       The following  line shows  that if  the file  does
  1270.                       exist, to go to the label :DOIT
  1271.             
  1272.                       IF (exist("LOTUS.DAT")=1) GOTO :DOIT
  1273.             ____________________________________________________________
  1274.             
  1275.             FUNCTION: EXIT                               TYPE: BRANCHING
  1276.             
  1277.             SYNTAX:   EXIT [message]
  1278.             
  1279.             PURPOSE:  This function  is used  to stop  all processing of
  1280.                       the command  file, and the system will be returned
  1281.                       to the next highest level.  If the script file was
  1282.                       started at  the DOS  prompt, the EXIT command will
  1283.                       exit BitCom  to DOS.   The  "message" argument  is
  1284.                       optional.   If given, it will appear on the screen
  1285.                       after the command file processing is stopped.  The
  1286.                       message may be either a string or a variable name.
  1287.                       This command  is similar  to the RETURN command in
  1288.                       PASCAL or the RETSUB command in BASIC.
  1289.             
  1290.             EXAMPLE:  In the  sample file  ANSWER.ACT, processing of the
  1291.                       command file  will be stopeed if a proper filename
  1292.                       is not  found.  The system will be returned to the
  1293.                       level the action file was started from.
  1294.             
  1295.                       :badfile
  1296.                       "File Not Found$0d$0a";
  1297.                       exit
  1298.             
  1299.             
  1300.  
  1301.  
  1302.                                                                        26
  1303.  
  1304.  
  1305.  
  1306.             FUNCTION: EXPR                           TYPE: MISCELLANEOUS
  1307.             
  1308.             SYNTAX:   EXPR(expression)
  1309.             
  1310.             PURPOSE:  This function  will evaluate  the given expression
  1311.                       and return  its value.  The expression may consist
  1312.                       of  constants,   variables   or   function   calls
  1313.                       separated by operators.  Valid operators are:
  1314.             
  1315.                       +         Addition
  1316.                       -         Subtraction
  1317.                       *         Multiplication
  1318.                       /         Division
  1319.             
  1320.                       Multiplication and  division are  performed before
  1321.                       addition  or   subtraction,  but   the  order   of
  1322.                       calculation  may  be  controlled  by  the  use  of
  1323.                       parentheses.
  1324.             
  1325.             EXAMPLE:  In  this  example,  the  scratch  variable  @c  is
  1326.                       assigned to the expression of @c plus one.
  1327.             
  1328.                       @c = expr(@c + 1);
  1329.             
  1330.                       The following  example will  calculate 2  + 2  and
  1331.                       display the result of 4 on the screen.  We suggest
  1332.                       that  you   put  a  space  before  and  after  any
  1333.                       operator.
  1334.             
  1335.                       TYPE(EXPR(2 + 2))
  1336.             ____________________________________________________________
  1337.             
  1338.             FUNCTION: GETCH                               TYPE: PORT I/O
  1339.             
  1340.             SYNTAX:   @a = GETCH
  1341.             
  1342.             PURPOSE:  This  function  will  read  a  character  that  is
  1343.                       received from  the port.   If  a character  is not
  1344.                       available, it will return a -1.  If a character is
  1345.                       available, it will return that character.
  1346.             
  1347.             EXAMPLE:  :loop
  1348.                       IF (getch = -1) goto :loop
  1349.             
  1350.                       The above  2 lines would wait until a character is
  1351.                       received from  the host.   If  a character  is not
  1352.                       received, it will go back and wait again.
  1353.             
  1354.             
  1355.  
  1356.  
  1357.                                                                        27
  1358.  
  1359.  
  1360.  
  1361.             FUNCTION: GETCHW                              TYPE: PORT I/O
  1362.             
  1363.             SYNTAX:   @a = GETCHW
  1364.             
  1365.             PURPOSE:  This  function  will  read  a  character  that  is
  1366.                       returned from  the host  computer.    If  none  is
  1367.                       available, it  will wait  for one.  It will always
  1368.                       return the character that is read.
  1369.             
  1370.             EXAMPLE:  This example would tell the host to hit a key, and
  1371.                       then wait until it does.
  1372.             
  1373.                       "Press any key to continue"
  1374.                       getchw
  1375.             ____________________________________________________________
  1376.             
  1377.             FUNCTION: GETLINE                             TYPE: PORT I/O
  1378.             
  1379.             SYNTAX:   @a = GETLINE
  1380.             
  1381.             PURPOSE:  This function  is used  to get a line of text that
  1382.                       ends with  a carriage return or line feed from the
  1383.                       host computer.
  1384.             
  1385.             EXAMPLE:  As shown  in the  file ANSWER.ACT,  the  following
  1386.                       lines make use of the function GETLINE.
  1387.             
  1388.                       "ENTER PASSWORD:"        {get password}
  1389.                       @a=getline
  1390.             
  1391.                       This will  get a line of text and assign it to the
  1392.                       scratch variable of @a for later processing within
  1393.                       the file.
  1394.             ____________________________________________________________
  1395.             
  1396.             FUNCTION: GOTO                               TYPE: BRANCHING
  1397.             
  1398.             SYNTAX:   GOTO :label;
  1399.             
  1400.             PURPOSE:  This function  is  used  to  cause  processing  to
  1401.                       continue at  the line  beginning  with  the  given
  1402.                       label name.
  1403.             
  1404.             EXAMPLE:  In this  example,  if  the  file  "HELLO"  exists,
  1405.                       processing will begin at the label of :OK.
  1406.             
  1407.                       IF (exist("HELLO")=1) goto :OK
  1408.                       :OK
  1409.             
  1410.             
  1411.  
  1412.  
  1413.                                                                        28
  1414.  
  1415.  
  1416.  
  1417.             FUNCTION: HANGUP                            TYPE: CONNECTION
  1418.             
  1419.             SYNTAX:   HANGUP
  1420.             
  1421.             PURPOSE:  This  function  transmits  the  currently  defined
  1422.                       hangup string to the modem.  The currently defined
  1423.                       hangup  string  can  be  shown  with  the  @HANGUP
  1424.                       function.   After the  hangup command is executed,
  1425.                       BitCom will  return either to the menu the session
  1426.                       was started  from, or to DOS if BitCom was started
  1427.                       from the DOS command line.
  1428.             
  1429.                       If you  have started  the script file from the DOS
  1430.                       prompt, the  file will  be invoked  again when you
  1431.                       use the  HANGUP command,  unless it is followed by
  1432.                       the CANCEL command.
  1433.             
  1434.             EXAMPLE:  In this  example, if too many tries for a password
  1435.                       are made,  the hangup  function will be invoked to
  1436.                       hang up the phone.
  1437.             
  1438.                       "Too many attempts..."
  1439.                       hangup
  1440.                       exit
  1441.             
  1442.                       Be sure  to use  the EXIT  command after HANGUP to
  1443.                       stop the processing of the script file.
  1444.             
  1445.                       Another example  is to  assign the HANGUP function
  1446.                       to a  function  key,  so  that  when  the  key  is
  1447.                       pressed, BitCom  will hangup  and  return  to  the
  1448.                       previous state.
  1449.             
  1450.                       @ALT-H = 'hangup'
  1451.             
  1452.             
  1453.  
  1454.  
  1455.                                                                        29
  1456.  
  1457.  
  1458.  
  1459.             FUNCTION: HELPLINE                         TYPE: DISPLAY I/O
  1460.             
  1461.             SYNTAX:   HELPLINE("MSG1 KEY1;....MSGX KEYX")
  1462.             
  1463.             PURPOSE:  This function  is used to replace the default help
  1464.                       messages that  appears on the lower left corner of
  1465.                       your screen  during communications  with your  own
  1466.                       help messages.  The default help messages are:
  1467.             
  1468.                       HELP      F1             OPTIONS   F2
  1469.             
  1470.                       The "message"  argument is  your own  message that
  1471.                       will apply  to a  certain key that is specified in
  1472.                       the  "key"   argument.    Note  that  the  message
  1473.                       argument must not contain any spaces.
  1474.             
  1475.             EXAMPLE:  The following  example will  show that CAPTURE can
  1476.                       be turned off with the F9 key.
  1477.             
  1478.                       HELPLINE("CAPTOFF F9;      HELP F1")
  1479.             ____________________________________________________________
  1480.             
  1481.             FUNCTION: IF                               TYPE: CONDITIONAL
  1482.             
  1483.             SYNTAX:   IF (condition) statement 1; else statement 2
  1484.             
  1485.             PURPOSE:  The IF  statement is used to test for a condition.
  1486.                       If true,  the remainder  of the  statements on the
  1487.                       line are  executed.  Otherwise, the statements are
  1488.                       skipped.   A condition  may consist  of comparison
  1489.                       operators, with AND and OR operators.  Parentheses
  1490.                       may be used to control the order of comparison.
  1491.             
  1492.                       Valid comparison operators are:
  1493.             
  1494.                       =              Test for equality
  1495.                       <>             Test for inequality
  1496.                       >              Test for greater than
  1497.                       <              Test for less than
  1498.                       >=             Test for greater than or equal to
  1499.                       <=             Test for less than or equal to
  1500.             
  1501.             EXAMPLE:  IF (@a=":")
  1502.                       goto :gotcolon
  1503.             
  1504.                       If the  contents of @a are a colon, BitCom will go
  1505.                       to the label :gotcolon.
  1506.             
  1507.                       :loop1
  1508.                       @a=getchw
  1509.                       if((@a<>":") and (@a<>"?")) goto :loop1
  1510.             
  1511.  
  1512.  
  1513.                                                                        30
  1514.  
  1515.  
  1516.  
  1517.                       If the character received by the getchw command is
  1518.                       not a colon or a question mark, BitCom will return
  1519.                       to the label of :loop1.
  1520.             
  1521.                       IF (@echo=0) type("ECHO OFF");ELSE type("ECHO ON")
  1522.             
  1523.                       In this example, if @echo is equal to 0, the first
  1524.                       statement would  be typed.   If  @echo is equal to
  1525.                       anything  else,  the  second  statement  would  be
  1526.                       typed.
  1527.             ____________________________________________________________
  1528.             
  1529.             FUNCTION: INVOKE                             TYPE: BRANCHING
  1530.             
  1531.             SYNTAX:   INVOKE filename [arg1...arg9];
  1532.             
  1533.             PURPOSE:  This  function  is  used  to  begin  execution  of
  1534.                       another command  file.   This is similar to a sub-
  1535.                       routine  call   in  BASIC   or  other  programming
  1536.                       languages.
  1537.             
  1538.             EXAMPLE:  In this  example, from  the file EASYLINK.ACT, the
  1539.                       last line  of the  file will  invoke HANDYKEY.ACT,
  1540.                       another action file on the program diskette.
  1541.             
  1542.                       invoke handykey
  1543.             ____________________________________________________________
  1544.             
  1545.             FUNCTION: KEREND                         TYPE: FILE TRANSFER
  1546.             
  1547.             SYNTAX:   KEREND("opt")
  1548.             
  1549.             PURPOSE:  This Kermit  function terminates  the  interaction
  1550.                       with a  Kermit server.   If  "opt" =  "finish", it
  1551.                       tells the server to exit.  If "opt" = "logout", it
  1552.                       tells the  server to  exit AND  to disconnect  the
  1553.                       line.
  1554.             
  1555.             EXAMPLE:
  1556.             
  1557.                       KEREND("finish")    {tells the server to exit,}
  1558.                                           {but stay connected.}
  1559.             
  1560.             
  1561.  
  1562.  
  1563.                                                                        31
  1564.  
  1565.  
  1566.  
  1567.             FUNCTION: KERGET                         TYPE: FILE TRANSFER
  1568.             
  1569.             SYNTAX:   KERGET("filename"[,"recvfilename"])
  1570.             
  1571.             PURPOSE:  This Kermit  function requests  that the host send
  1572.                       the given  filename.   The host  must  be  in  the
  1573.                       server mode  before issuing  this  command.    The
  1574.                       first file  sent will  be placed  in  the  receive
  1575.                       filename, if one is given.
  1576.             
  1577.             EXAMPLE:  KERGET("test.doc","test1.doc")
  1578.             
  1579.                       This will  request that  the server  send the file
  1580.                       TEST.DOC, and  save it to the receiving side under
  1581.                       the filename TEST1.DOC.
  1582.             ____________________________________________________________
  1583.             
  1584.             FUNCTION: KERRECV                        TYPE: FILE TRANSFER
  1585.             
  1586.             SYNTAX:   KERRECV
  1587.             
  1588.             PURPOSE:  This Kermit  function begins  waiting for  one  or
  1589.                       more files  to be  sent from  the host  using  the
  1590.                       Kermit protocol.   The  receive filename should be
  1591.                       omitted.  The filename can include a path.  If the
  1592.                       transaction is  successful, it will return a zero.
  1593.                       If it was unsuccessful, it will return a -1.
  1594.             
  1595.             EXAMPLE:  KERRRECV
  1596.             
  1597.                       This example  will receive  files into the current
  1598.                       directory (or  the directory  specified in @DLDIR)
  1599.                       using the Kermit protocol.  The file names will be
  1600.                       created by the sending computer.
  1601.             ____________________________________________________________
  1602.             
  1603.             FUNCTION: KERSEND                        TYPE: FILE TRANSFER
  1604.             
  1605.             SYNTAX:   KERSEND("filename")
  1606.             
  1607.             PURPOSE:  This Kermit  function will  send one or more files
  1608.                       to the  host using  the Kermit protocol.  The host
  1609.                       must already be in the Kermit receive mode, or the
  1610.                       Kermit server mode.  This function will return a -
  1611.                       1 if  it was  unsuccessful, and  a zero  if it was
  1612.                       successful.
  1613.             
  1614.             EXAMPLE:  KERSEND("test1.doc")
  1615.             
  1616.                       This line  will send the file TEST1.DOC, using the
  1617.                       Kermit protocol.
  1618.             
  1619.  
  1620.  
  1621.                                                                        32
  1622.  
  1623.  
  1624.  
  1625.             
  1626.             FUNCTION: MESSAGE                          TYPE: DISPLAY I/O
  1627.             
  1628.             SYNTAX:   MESSAGE(string)
  1629.             
  1630.             PURPOSE:  This function  is used to display the given string
  1631.                       in the  message area  of the  display (lower right
  1632.                       corner of  the screen).  This function will always
  1633.                       return a zero.
  1634.             
  1635.             EXAMPLE:  In  the  emulation  file  VT100A.EMU,  if  certain
  1636.                       characters are  received, you  will be prompted to
  1637.                       use the emulation file VT100B.EMU as shown below.
  1638.             
  1639.             [?21      message("Received VT52 sequence. Use VT100B.EMU");
  1640.             ____________________________________________________________
  1641.             
  1642.             FUNCTION: POSCUR                           TYPE: DISPLAY I/O
  1643.             
  1644.             SYNTAX:   POSCUR(col,row)
  1645.             
  1646.             PURPOSE:  This function  is used  to move the current cursor
  1647.                       position to  a specific column and row.  The valid
  1648.                       ranges are:
  1649.             
  1650.                       col = 1 - 80   (or 132)
  1651.                       row = 1 - 24   (or  any   number  defined  in  the
  1652.                                      @MAXROW variable  within an  action
  1653.                                      file)
  1654.             
  1655.                       This function will always return a zero.
  1656.             
  1657.             EXAMPLE:  This statement  will set  the cursor  position  at
  1658.                       column 1 and row 1.
  1659.             
  1660.                       poscur(1,1)
  1661.             ____________________________________________________________
  1662.             
  1663.             FUNCTION: PRINTER                        TYPE: MISCELLANEOUS
  1664.             
  1665.             SYNTAX:   PRINTER(1)
  1666.                       PRINTER(0)
  1667.             
  1668.             PURPOSE:  This function  is used  to enable  or disable  the
  1669.                       printer logging  on and  off.   PRINTER(1) enables
  1670.                       the print  function.   Everything appearing on the
  1671.                       screen after  this command  would be echoed to the
  1672.                       printer.     PRINTER(0)  will  disable  the  print
  1673.                       function.
  1674.             
  1675.                       Make sure  that your  printer is connected and on-
  1676.                       line when using this function.
  1677.  
  1678.  
  1679.                                                                        33
  1680.  
  1681.  
  1682.  
  1683.             
  1684.             EXAMPLE:  In this  file, the print function will be enabled;
  1685.                       files will  be read,  and then  the print function
  1686.                       will be  disabled.   This example is from the file
  1687.                       EASYLINK.ACT.
  1688.             
  1689.             printer(1)          {print function on}
  1690.             "/READALL$0a"       {read message, print & capture data}
  1691.             cwait("PTS")        {wait for easylink ready again}
  1692.             printer(0)          {print function off}
  1693.             ____________________________________________________________
  1694.             
  1695.             FUNCTION: PROMPT                           TYPE: DISPLAY I/O
  1696.             
  1697.             SYNTAX:   PROMPT(string)
  1698.             
  1699.             PURPOSE:  This function  will type  the given  string on the
  1700.                       display (without a carriage return), and then read
  1701.                       from the keyboard until the carriage return key is
  1702.                       pressed.   The string  that  is  entered  will  be
  1703.                       returned.
  1704.             
  1705.                       Note that the prompt is only sent to your display,
  1706.                       and not to the host computer.
  1707.             
  1708.             EXAMPLE:  In this  example, the  prompt shown in parentheses
  1709.                       is assigned to the scratch variable @b.
  1710.             
  1711.                       @b=prompt("Enter X for XMODEM, A for ASCII:");
  1712.             
  1713.                       The following example shows you how to combine the
  1714.                       SENDFILE function with the PROMPT function.
  1715.             
  1716.                  @alt-s='SENDFILE("PROMPT("SEND FILENAME?")","XMODEM")'
  1717.             ____________________________________________________________
  1718.             
  1719.             FUNCTION: RECVFILE                       TYPE: FILE TRANSFER
  1720.             
  1721.             SYNTAX:   RECVFILE(filename,mode [eof])
  1722.             
  1723.             PURPOSE:  This function  initiates  a  file  receive.    The
  1724.                       variable 'filename'  is the  name you will receive
  1725.                       the file  under.   The 'mode' may be either XMODEM
  1726.                       or ASCII.  If the mode is ASCII, you may also give
  1727.                       the string  to indicate  the end-of-file  has been
  1728.                       reached.  If this argument is omitted, Ctrl-Z (Hex
  1729.                       1A) will  be taken  as the  end-of-file character.
  1730.                       When using  the Kermit  protocol, use  the KERRECV
  1731.                       function instead.
  1732.             
  1733.  
  1734.  
  1735.                                                                        34
  1736.  
  1737.  
  1738.  
  1739.                       You can  use this  command to  receive files under
  1740.                       the YMODEM protocol, by using wild card characters
  1741.                       in the filename, such as:
  1742.             
  1743.                       RECVFILE("*.*","XMODEM")
  1744.             
  1745.             EXAMPLE:  The following  example is  the last  line  of  the
  1746.                       sample ACTION  file RECFILE.ACT  which is  on your
  1747.                       program diskette.   The  scratch variable  @a  was
  1748.                       previously assigned the value of a given filename.
  1749.             
  1750.                       @A = prompt("ENTER FILE NAME");
  1751.                       RECVFILE("@a","ASCII","$07");
  1752.             
  1753.                       Note that  in the  above example,  the end-of-file
  1754.                       mark has been changed to Hex 7.
  1755.             ____________________________________________________________
  1756.             
  1757.             FUNCTION: SBREAK                              TYPE: PORT I/O
  1758.             
  1759.             SYNTAX:   SBREAK
  1760.             
  1761.             PURPOSE:  This function  is used  to send  a break signal to
  1762.                       the host  computer.   This performs  as if you had
  1763.                       pressed the  BREAK key  that was  defined on  your
  1764.                       Communication Parameters Menu.
  1765.             
  1766.             EXAMPLE:  In this  example, the system would wait 2 seconds,
  1767.                       and then send a break signal to the host.
  1768.             
  1769.                       TWAIT(2,"SEC")
  1770.                       SBREAK
  1771.             ____________________________________________________________
  1772.             
  1773.             FUNCTION: SELECT                            TYPE: CONNECTION
  1774.             
  1775.             SYNTAX:   SELECT (Rec_ID)
  1776.             
  1777.             PURPOSE:  This function  will select the given Record ID for
  1778.                       later use with the DOCOMM function.  It is used in
  1779.                       SCRIPT files.    The  Record  ID  must  have  been
  1780.                       previously   defined,   either   through   builtin
  1781.                       variables, or  the Communications Parameters Menu.
  1782.                       The running  of the  SCRIPT file will be cancelled
  1783.                       if the given Record ID is not found.
  1784.             
  1785.  
  1786.  
  1787.                                                                        35
  1788.  
  1789.  
  1790.  
  1791.             EXAMPLE:  This example will select the "EASYLINK" record and
  1792.                       dial the phone number contained in that record.
  1793.             
  1794.                       SELECT(EASYLINK)
  1795.                       DOCOMM
  1796.             
  1797.                       Note:     Selecting  a   record  will  change  the
  1798.                       parameter settings  such  as  parity,  stop  bits,
  1799.                       emulation filename, and capture filename.  You can
  1800.                       select a  different record  while online.  This is
  1801.                       useful in  assigning a different capture file when
  1802.                       you switch to another session.
  1803.             ____________________________________________________________
  1804.             
  1805.             FUNCTION: SENDFILE                       TYPE: FILE TRANSFER
  1806.             
  1807.             SYNTAX:   SENDFILE(filename,mode)
  1808.             
  1809.             PURPOSE:  This function  initiates a file send.  It may only
  1810.                       be used  after a  connection has been established.
  1811.                       It has  two arguments  which must be defined.  The
  1812.                       filename is  the name  of the  file which  will be
  1813.                       sent, and  the mode may either be XMODEM or ASCII.
  1814.                       When using  the Kermit  protocol, use  the KERSEND
  1815.                       function instead.   This  function will  return  a
  1816.                       zero if  it was  successful, and  a -1  if it  was
  1817.                       unsuccessful.
  1818.             
  1819.             EXAMPLE:  This example will send the file "BITCOM.EXE" using
  1820.                       the XMODEM protocol.
  1821.             
  1822.                       SENDFILE("BITCOM.EXE","XMODEM")
  1823.             ____________________________________________________________
  1824.             
  1825.             FUNCTION: SETCOLOR                         TYPE: DISPLAY I/O
  1826.             
  1827.             SYNTAX:   SETCOLOR(m)
  1828.             
  1829.             PURPOSE:  This function will set the initial screen color to
  1830.                       the value of 'm'.  When the CLEAR command is later
  1831.                       used, the  screen will  be cleared,  and the color
  1832.                       set to  the value  of 'm'.    Refer  to  the  file
  1833.                       REFER.TXT for  color codes.   The default color is
  1834.                       white characters  on a blue background.  The value
  1835.                       of 'm' is a shown in decimal form.
  1836.             
  1837.             EXAMPLE:  SETCOLOR(23){blue background, white characters}
  1838.                       CLEAR
  1839.             
  1840.                       Note that  the  CLEAR  function  must  follow  the
  1841.                       SETCOLOR command  for  the  screen  attributes  to
  1842.                       change.
  1843.  
  1844.  
  1845.                                                                        36
  1846.  
  1847.  
  1848.  
  1849.             
  1850.             
  1851.             FUNCTION: SUBSTR                       TYPE: STRING HANDLING
  1852.             
  1853.             SYNTAX:   SUBSTR(string,start,len)
  1854.             
  1855.             PURPOSE:  This function returns a set of characters which is
  1856.                       a sub-set  of a given string.  "String" is a given
  1857.                       string that  you supply.   "Start" is the starting
  1858.                       character position  in the  string.   "Len" is the
  1859.                       number of characters returned.  Note that "String"
  1860.                       can be a variable argument or a string constant.
  1861.             
  1862.             EXAMPLE:  One example  is shown  here.   This  is  from  the
  1863.                       sample action  file ANSWER.ACT,  which is  on your
  1864.                       program diskette.
  1865.             
  1866.                       @a=getline
  1867.                       if (substr(@a,1,8) <> "JONATHAN")goto :badpw
  1868.                       goto :ok
  1869.             
  1870.                       This will return a sub-string of the given string,
  1871.                       starting at  character '1'  (where J  is the first
  1872.                       character).   The string  will be  '8'  characters
  1873.                       long.  The 'len' argument may be omitted, in which
  1874.                       case the  sub-string will be from the 'start' till
  1875.                       the end of the 'string'.
  1876.             ____________________________________________________________
  1877.             
  1878.             FUNCTION: TRACE                          TYPE: MISCELLANEOUS
  1879.             
  1880.             SYNTAX:   TRACE(1)
  1881.                       TRACE(0)
  1882.             
  1883.             PURPOSE:  This  function   is  used  to  enable/disable  the
  1884.                       tracing of  the  currently  running  SCRIPT/ACTION
  1885.                       file.  TRACE(1) begins tracing.  TRACE(0) disables
  1886.                       tracing (this  is  the  default  setting).    This
  1887.                       function will always return a  zero.
  1888.             
  1889.             EXAMPLE:  Trace(1) at  the beginning  of a  script or action
  1890.                       file will  trace (show  on the screen) the file as
  1891.                       it is being executed.
  1892.             
  1893.                       After trace  is enabled,  BitCom will display each
  1894.                       line of  the file  that it  is executing,  and the
  1895.                       result.   This is not the same as the Trace filter
  1896.                       on the Communications Parameters Menu.
  1897.             
  1898.                       TRACE(1)       {Begin tracing action file}
  1899.             
  1900.             
  1901.  
  1902.  
  1903.                                                                        37
  1904.  
  1905.  
  1906.  
  1907.             FUNCTION: TWAIT                             TYPE: EVENT WAIT
  1908.             
  1909.             SYNTAX:   TWAIT(time,"unit")
  1910.             
  1911.             PURPOSE:  This function  is used  to wait for a given period
  1912.                       of time,  shown in  the given  unit.   Valid units
  1913.                       are:
  1914.             
  1915.                       hsec           hundredths of seconds
  1916.                       sec            seconds
  1917.                       min            minutes
  1918.                       hour           hours
  1919.             
  1920.                       This function  will always  return a  zero.  While
  1921.                       you are  waiting, any characters received from the
  1922.                       communications port  will  be  passed  on  to  the
  1923.                       display.
  1924.             
  1925.             EXAMPLE:  The  following  command  will  delay  two  seconds
  1926.                       before continuing with the processing of the file.
  1927.             
  1928.                       TWAIT(2,"sec")      {wait 2 seconds}
  1929.             ____________________________________________________________
  1930.             
  1931.             FUNCTION: TYPE                             TYPE: DISPLAY I/O
  1932.             
  1933.             SYNTAX:   TYPE(string)
  1934.             
  1935.             PURPOSE:  This function  will type  the given  string at the
  1936.                       display.   No carriage  return  will  be  entered.
  1937.                       This function will always return a zero.
  1938.             
  1939.             EXAMPLE:  Following are some examples of the TYPE function.
  1940.             
  1941.                       TYPE("PLEASE TURN ON THE PRINTER");
  1942.                       TYPE("The echo mode is @mode");
  1943.                       TYPE("The current window size is @mrow line");
  1944.                       IF (@echo=1) TYPE("ECHO IS ON");
  1945.             
  1946.                       Note that  the string  will only  be shown on your
  1947.                       display, and  not sent  through the communications
  1948.                       port.
  1949.             
  1950.             
  1951.  
  1952.  
  1953.                                                                        38
  1954.  
  1955.  
  1956.  
  1957.             FUNCTION: TYPECR                           TYPE: DISPLAY I/O
  1958.             
  1959.             SYNTAX:   TYPECR(string)
  1960.             
  1961.             PURPOSE:  This function  will type  the given  string at the
  1962.                       display,  and  end  the  string  with  a  carriage
  1963.                       return.   This function will always return a zero.
  1964.                       This function  works exactly like TYPE except that
  1965.                       the cursor  is brought  to a  new line  after  the
  1966.                       message is displayed.
  1967.             
  1968.             EXAMPLE:  In this  example, a  line of text will be typed on
  1969.                       the display.   The  cursor will then move down one
  1970.                       line.
  1971.             
  1972.                            typecr("LOGON OK");
  1973.             
  1974.                       Note that  the string  will only  be shown on your
  1975.                       display, and  not sent  through the communications
  1976.                       port.
  1977.             ____________________________________________________________
  1978.             
  1979.             FUNCTION: WAIT                              TYPE: EVENT WAIT
  1980.             
  1981.             SYNTAX:   WAIT(hour,min)
  1982.             
  1983.             PURPOSE:  This function is used to wait until the given hour
  1984.                       and minute  occurs.   The hour must be given in 24
  1985.                       hour time.   The  wait will  occur until  the next
  1986.                       occurrence of  the given time.  This function will
  1987.                       always return  a zero.   Note  that while  you are
  1988.                       waiting,  any   characters   received   from   the
  1989.                       communications port  will  be  passed  on  to  the
  1990.                       display.
  1991.             
  1992.             EXAMPLE:  Following is an example in which the WAIT function
  1993.                       is used.
  1994.             
  1995.                       WAIT(23,59)         {WAIT UNTIL 11:59 PM}
  1996.             
  1997.             
  1998.  
  1999.  
  2000.                                                                        39
  2001.  
  2002.  
  2003.  
  2004.             FUNCTION: WWAIT                             TYPE: EVENT WAIT
  2005.             
  2006.             SYNTAX:   WWAIT(time)
  2007.             
  2008.             PURPOSE:  This function  is used  to wait until there are no
  2009.                       characters received  on the line for the number of
  2010.                       seconds shown  in  'time'.    This  is  useful  to
  2011.                       determine when  the host is prompting you for some
  2012.                       input.  If you are unsure what the prompt will be,
  2013.                       you can  check the  last word  in the  prompt  and
  2014.                       respond accordingly.
  2015.             
  2016.             EXAMPLE:  wwait(30){wait for 30 seconds if nothing received}
  2017.             
  2018.                       This example  will simply  wait for  30 seconds if
  2019.                       nothing is received on the line.
  2020.             
  2021.                       @a=wwait(2)
  2022.                       if(@a="name?") goto :cont;
  2023.             
  2024.                       The above example will wait for the string 'name'.
  2025.                       If not  received within 2 seconds, processing will
  2026.                       continue.   If the  string "name"  is received, it
  2027.                       will go to the label of :cont.
  2028.